﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="set_object.aspx.cs" Inherits="EDP.Application.Web.Permission.set_object" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
</head>
<body>
    <style type="text/css">
        .x-column-header {
            text-align: center;
        }
    </style>
    <form id="form1" runat="server">
        <f:PageManager ID="PageManager" AutoSizePanelID="panel" runat="server" />
        <f:Panel ID="panel" runat="server" ShowBorder="false" ShowHeader="false" Margin="10" Layout="Region">
            <Items>
                <f:Tree ID="tree_permission" runat="server" Title="权限对象" Margin="0" RegionPosition="Left" Width="400" OnNodeCheck="tree_permission_NodeCheck">
                    <Toolbars>
                        <f:Toolbar runat="server" ToolbarAlign="Left">
                            <Items>
                                <f:DropDownList ID="ddl_permissionObjectType" runat="server" Margin="0" Width="120" AutoPostBack="true" OnSelectedIndexChanged="ddl_permissionObjectType_SelectedIndexChanged" />
                                <f:TextBox ID="tb_permissionKeyword" runat="server" Margin="0 0 0 5" Width="180" />
                                <f:Button ID="btn_permissionQuery" runat="server" Text=" 查 询 " Icon="SystemSearch" Margin="0 0 0 10" OnClick="btn_permissionQuery_Click" />
                            </Items>
                        </f:Toolbar>
                    </Toolbars>
                </f:Tree>
                <f:Grid ID="grid_permission" runat="server" Title="已授权的权限对象" DataKeyNames="ID,SourceId" Margin="0 0 0 5" EnableCheckBoxSelect="true" CheckBoxSelectOnly="true" RegionPosition="Center"
                    OnPreRowDataBound="grid_permission_PreRowDataBound" SortField="BelongPermissionName" OnSort="grid_permission_Sort" OnPageIndexChange="grid_permission_PageIndexChange" OnRowCommand="grid_permission_RowCommand">
                    <Toolbars>
                        <f:Toolbar runat="server" ToolbarAlign="Right" QueryToolbar="true">
                            <Items>
                                <f:DropDownList ID="ddl_permissionType" runat="server" QueryName="PermissionTypeId" Margin="0" Width="120" />
                                <f:TextBox ID="tb_keyword" runat="server" EmptyText="所属权限对象/权限对象" QueryName="PermissionNameKeyrowd" Margin="0 0 0 10" Width="240" />
                                <f:Button ID="btn_query" runat="server" Text=" 查 询 " Icon="SystemSearch" Margin="0 0 0 10" OnClick="QueryClick" />
                                <f:ToolbarFill runat="server" />
                                <f:Button ID="btn_save" runat="server" Text=" 保 存 " Icon="Disk" Margin="0 10 0 0" OnClick="btn_save_Click" />
                                <f:Button ID="btn_close" runat="server" Text=" 关 闭 " Icon="Cross" Margin="0 10 0 0" />
                                <f:Button ID="btn_more" runat="server" EnablePermission="false" Text="更多..." EnablePostBack="false">
                                    <Menu runat="server" Margin="0">
                                        <f:MenuButton ID="btn_delete" runat="server" Margin="0" Text="删除权限" ConfirmTitle="删除权限" ConfirmText="是否删除所选权限？" ConfirmTarget="Self" ConfirmIcon="Question" OnClick="btn_delete_Click" />
                                        <f:MenuButton ID="btn_cache" runat="server" Margin="0" Text="重置缓存" ConfirmTitle="重置缓存" ConfirmText="是否重置缓存？" ConfirmTarget="Self" ConfirmIcon="Question" OnClick="btn_cache_Click" />
                                    </Menu>
                                </f:Button>
                            </Items>
                        </f:Toolbar>
                    </Toolbars>
                    <Columns>
                        <f:BoundField DataField="BelongPermissionName" ExpandUnusedSpace="true" HeaderText="所属权限对象" />
                        <f:BoundField DataField="PermissionName" ExpandUnusedSpace="true" HeaderText="权限对象" />
                        <f:BoundField DataField="PermissionTypeName" SortField="PermissionTypeId" Width="100" HeaderText="权限对象类型" />
                        <f:BoundField DataField="ElementId" Width="150" HeaderText="元素ID" NullDisplayText="--" />
                        <f:CheckBoxField DataField="IsGridElement" Width="75" HeaderText="列表元素" TextAlign="center" />
                        <f:BoundField DataField="SourceName" SortField="SourceId" Width="100" HeaderText="来源" />
                        <f:LinkButtonField ColumnID="lb_delete" Width="30" CommandName="delete" CommandTitle="删除权限" ToolTip="删除" Icon="Delete" EnableLock="true"
                            ConfirmTitle="删除权限" ConfirmText="是否删除该权限？" ConfirmTarget="Self" ConfirmIcon="Question" TextAlign="center" />
                    </Columns>
                </f:Grid>
            </Items>
        </f:Panel>
    </form>
    <script type="text/javascript">
        F.ready(function () {
            $("#panel_tree_permission_ctl00_tb_permissionKeyword").on("keyup", function () {
                if (event.keyCode == 13) {
                    F.f_disable('panel_tree_permission_ctl00_btn_permissionQuery');
                    __doPostBack('panel$tree_permission$ctl00$btn_permissionQuery', '');
                }
            });

            $("#panel_grid_permission_ctl00_tb_keyword").on("keyup", function () {
                if (event.keyCode == 13) {
                    F.f_disable('panel_grid_permission_ctl00_btn_query');
                    __doPostBack('panel$grid_permission$ctl00$btn_query', '');
                }
            });
        });
    </script>
</body>
</html>
